UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3WK92ll1nXEIvDhsdspbCFEwE3WXUsQyeIqQ5t8GGTA=' 
WHERE 
  key_id = '04c86e363824138702a3d6025228fd9c2d709cc486a2e9378b680c9a84135f9c' 
  AND (
    token = '3WK92ll1nXEIvDhsdspbCFEwE3WXUsQyeIqQ5t8GGTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029