UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fe8s10iEv9MnutiDJfk5jCfe3qUhAzi3Ce4i8BgB2EY=' 
WHERE 
  key_id = 'fd80771efd7e354edfd71430484ddc9dd94118466f342e8210db2771eedadd33' 
  AND (
    token = 'Fe8s10iEv9MnutiDJfk5jCfe3qUhAzi3Ce4i8BgB2EY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019