UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '33avHfdSHk21cekKB3sH2VlxLcIMl25LTWJzJ2J3cl4='
WHERE
key_id = '0372f4f9f76ff3b6c7879c7db1c545916a830ecd74e6e0cd5771a05782640c17'
AND (
token = '33avHfdSHk21cekKB3sH2VlxLcIMl25LTWJzJ2J3cl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)