UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fEw13MeKy9isLpHzPYBMP5fYNUM0KPzBGNrQw2XKpjk=' 
WHERE 
  key_id = '20b91783e0d16e30cdeff0d0d6379fee3f378322cdb39de3ca8e4de3cd649375' 
  AND (
    token = 'fEw13MeKy9isLpHzPYBMP5fYNUM0KPzBGNrQw2XKpjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036