UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '85zH6xiDCWgMNtY4cv2zFqQSKpGQfzp6WCvugByWmSA='
WHERE
key_id = '0f2d33319ad3c4e10eef555c9d7beebdafdc65c6e8a571f382bc1da147d1b989'
AND (
token = '85zH6xiDCWgMNtY4cv2zFqQSKpGQfzp6WCvugByWmSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)