UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Dnh+00naF/tuBTtIo58oaXAwGnaOJEtWPldNfpvazU=' 
WHERE 
  key_id = '56ec9159831b837c4b323ba1244f0bd4a4e947054b23dfadf1eecc404be22305' 
  AND (
    token = '4Dnh+00naF/tuBTtIo58oaXAwGnaOJEtWPldNfpvazU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015