UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Gucd2jJ9GqL6oPhXPuX/easI1XqXzkkhs9xbyiI684='
WHERE
key_id = '95e3df4bca5dbeaef03e8544fa7a5d1b4bb65d7a2d9ab6510612cabc5b59c9ee'
AND (
token = '2Gucd2jJ9GqL6oPhXPuX/easI1XqXzkkhs9xbyiI684='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)