UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FSvaTOeglnFeh35VZQtDTk8JqMct0+q1ysfT6kvmzMU='
WHERE
key_id = '0943e6fd3b9f2af255fc89fd5f81be1a90849bf5c8b282316c1c35c9fb5cac77'
AND (
token = 'FSvaTOeglnFeh35VZQtDTk8JqMct0+q1ysfT6kvmzMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)