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