UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Il7oI1O+jTTaT91aykHsLMSa0dHMX26W/nzAMdBTPI='
WHERE
key_id = 'ddaea685918713e7058e6ebe4e5daa264d32494b188f28d08e8ee4b992ad295d'
AND (
token = '6Il7oI1O+jTTaT91aykHsLMSa0dHMX26W/nzAMdBTPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)