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