UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8U6v0frdp+Ooh8anIguiwWL8bylF2mXQI6qNucKXd2M='
WHERE
key_id = '709ff699afc764c9dc2ed1f62de39af4f7de9eadd812fcfdd108c09b1e4a2342'
AND (
token = '8U6v0frdp+Ooh8anIguiwWL8bylF2mXQI6qNucKXd2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)