UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TeX2H3YYDMl2fINsD/IQAhRzQ9q/BPk5NnlNlKtB+kM='
WHERE
key_id = '47a8968e6b4bdec254f96c1d090aed45b909a5b3e619be1db5a700e8e66f69c7'
AND (
token = 'TeX2H3YYDMl2fINsD/IQAhRzQ9q/BPk5NnlNlKtB+kM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)