UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X7xeEE0YgjcBMr9Q30Zy6bR/a8bDn75mf+0gDAh7Vwg='
WHERE
key_id = '0498893267a5c67e76a6ae83df52598da724724bf3bc16fb80e818f8b05a954a'
AND (
token = 'X7xeEE0YgjcBMr9Q30Zy6bR/a8bDn75mf+0gDAh7Vwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)