UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GivUcJdFewTqLBHvhotUzN2Lji++Ql4146Ub7fm6eXU='
WHERE
key_id = '2ea61f1f532fcf8710dcf0a46613931e152dedd08feb46442d0fc36e160f56f4'
AND (
token = 'GivUcJdFewTqLBHvhotUzN2Lji++Ql4146Ub7fm6eXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)