UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hq1KX/S7ZlXG7/JygV+uW6jS3U7lCf+vTmqDUZRbpFc='
WHERE
key_id = '3055d5a0491fa5cb56a883fc4a90977120a8290aac8d460f6b5517760ee87c8a'
AND (
token = 'hq1KX/S7ZlXG7/JygV+uW6jS3U7lCf+vTmqDUZRbpFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)