UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+IZNlPpbCTPivPgq94Rsx6aeDkxsEmj23yR0GxNRv9k=' 
WHERE 
  key_id = '004b2454faa188063e1652cb198ff3c945ed61c060141d1475dc8cb1c6b1cafb' 
  AND (
    token = '+IZNlPpbCTPivPgq94Rsx6aeDkxsEmj23yR0GxNRv9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036