UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's78s0MEi6rmDq1pFs2A5sAybBQ8iolv3o0YL9tENGvw=' 
WHERE 
  key_id = '8fdf95e658af2040e363648301fd4f7dc27fc6c681ae17298a152c1087e4ce50' 
  AND (
    token = 's78s0MEi6rmDq1pFs2A5sAybBQ8iolv3o0YL9tENGvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027