UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tvtRgC2Z9bZDBTlJOUqndaGqa6VSxPkgJshmbz8GWLM='
WHERE
key_id = 'a9e9bf31c0813ef9f6b08ba0ddbed975f739b8e24fb358e5c1a77487c29128ff'
AND (
token = 'tvtRgC2Z9bZDBTlJOUqndaGqa6VSxPkgJshmbz8GWLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)