UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qqPOXCaXvP5+mFCPgW0gGHNphAn6XVOGO4U1yP+l7Xg=' 
WHERE 
  key_id = 'cd3ed61e91812506704812f6b77b8516a1439dc190d578c8741fac688ec22468' 
  AND (
    token = 'qqPOXCaXvP5+mFCPgW0gGHNphAn6XVOGO4U1yP+l7Xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027