UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0aA0ay26ez+VwVSzLq1yakj5HLFPCOi8FdKIcMTkuxw=' 
WHERE 
  key_id = '7bf51bd08015719e31597f171f590d3a6e0a4e49301563bef5460beeaa0c07fc' 
  AND (
    token = '0aA0ay26ez+VwVSzLq1yakj5HLFPCOi8FdKIcMTkuxw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028