UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H1xc6/VNl0vRrlR78SZgV0pOhKcXvDemiQfOl0i0nkI='
WHERE
key_id = 'd5c7fee29d12ff99c785463c42ceb87f571c10f557cfc66356ad5f7f26c39a83'
AND (
token = 'H1xc6/VNl0vRrlR78SZgV0pOhKcXvDemiQfOl0i0nkI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)