UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14qKJkQ1bZPgDxeRAiXsM61YhMrylYhTa+A4PzAV+KE='
WHERE
key_id = '2d20d84370f5992ce9dfda8d6885ae12bedd302c8f1c60321423dd3ab526b84f'
AND (
token = '14qKJkQ1bZPgDxeRAiXsM61YhMrylYhTa+A4PzAV+KE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)