UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5zT/fOhk17UbwsvNEhg4p5uNmNLiJ2MnHgE1TZwAf1Q='
WHERE
key_id = '6a7ba833a213c54c6b0621284b8afbb96fccd7d56a5c1ba863a7192f9ee720fe'
AND (
token = '5zT/fOhk17UbwsvNEhg4p5uNmNLiJ2MnHgE1TZwAf1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)