UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iDuGOgYBt3r9VRkJjcX6N9qQlTRTusqH/xhoV5fbBRc=' 
WHERE 
  key_id = 'c6f5c1a87343a43d208bf447c0394916a8b1dabd9f0420bb6a2e8cc59040785c' 
  AND (
    token = 'iDuGOgYBt3r9VRkJjcX6N9qQlTRTusqH/xhoV5fbBRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035