UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u7isghe27wYENYiu8OKN5E+O01RqfE3ZV5858hYars0='
WHERE
key_id = 'de5cdfc988b4e7439e3367473abe224276fb8e131a7e716ca5b6155f894670a4'
AND (
token = 'u7isghe27wYENYiu8OKN5E+O01RqfE3ZV5858hYars0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)