UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xV+xz5ju+/2fsoeoAjfV+pS/w5KezrrP5Mx7DBU932E=' 
WHERE 
  key_id = 'f11d5650f076498ff9f5b0fd4a9220e8ad4a25aee6408f2f599b0e63f65717e8' 
  AND (
    token = 'xV+xz5ju+/2fsoeoAjfV+pS/w5KezrrP5Mx7DBU932E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047