UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vDif/tQpj6N8A6NvUKlTHmZyn49zD2sFQUAVXF2GLd4=' 
WHERE 
  key_id = 'ed23f6f35f590f5ac5ce64a3833a30e94db1f099012acdd72ae78635052e416f' 
  AND (
    token = 'vDif/tQpj6N8A6NvUKlTHmZyn49zD2sFQUAVXF2GLd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022