UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ltzVpu0Q1J6wT7GWPxibEkiBf/DdybW69DPD0lG5zYM='
WHERE
key_id = '2fafbaf012288ce7bb6b164d70ac2a896de3a323c55f550c9142b0bc9840bb07'
AND (
token = 'ltzVpu0Q1J6wT7GWPxibEkiBf/DdybW69DPD0lG5zYM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)