UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0HHhYIQS8kkEHH6oMNCZmsRTpJTsorSFex41F7fJZho='
WHERE
key_id = 'de0c871ee136e77244fdec2049bbdbbed0e7a7db418b116c0da55dc2dfadcdaa'
AND (
token = '0HHhYIQS8kkEHH6oMNCZmsRTpJTsorSFex41F7fJZho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)