UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YOi7InTRhIs59O3+nSZh/TZCG9aYprdg03fMs96fqWM='
WHERE
key_id = 'e3cc4cbe7de71673ecdd777e65f93406b7ad346372782ea07a395a9f03068b53'
AND (
token = 'YOi7InTRhIs59O3+nSZh/TZCG9aYprdg03fMs96fqWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)