UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vzlkKLtWqvAVoqRltESLrtpJjf4ukI28z812hWGOBi4='
WHERE
key_id = '172b6cc82a35a305bfeea180a734aba4cb14bb53d5f2b9e9ef5ff2cb6e6f4aa5'
AND (
token = 'vzlkKLtWqvAVoqRltESLrtpJjf4ukI28z812hWGOBi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)