UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mIgsDUxgS8L92LM11Bti4wcpMPoou+AwiLSmTib6gDI='
WHERE
key_id = '5acdb9a370c361850fd0ddbd5f7d93b7c2129b54a3f84a235745f2a8c4a4c367'
AND (
token = 'mIgsDUxgS8L92LM11Bti4wcpMPoou+AwiLSmTib6gDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)