UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zIXP5AjnBOulu9rmt4Um67lUWJ9Wkqu0emcDsN2MNTY='
WHERE
key_id = '9c10641515e7e39d01ceebb0235fd323b6dc2727014f6aa98a1394e72826a728'
AND (
token = 'zIXP5AjnBOulu9rmt4Um67lUWJ9Wkqu0emcDsN2MNTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)