UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rwfHB2UfshY3FFjGZrFDQHfumuzHUTXxQGH/ftyMiss=' 
WHERE 
  key_id = 'aea6a689a97d4ac3d80abd828a897018d92fb0ef948157cc5848c510d0bfa7c9' 
  AND (
    token = 'rwfHB2UfshY3FFjGZrFDQHfumuzHUTXxQGH/ftyMiss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031