UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7jxbUVbW+Sg2O/BCkdRT9QIm75r/gmfhKwpcGi5dwS4='
WHERE
key_id = 'a044ab3bf4849ce5998acfb0adb6a15140467d11bc3a5e409e7a87139722d128'
AND (
token = '7jxbUVbW+Sg2O/BCkdRT9QIm75r/gmfhKwpcGi5dwS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)