UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pWdso2BCTdzLXirKb1hbmewLCtdzLQ/GNdIfKrCFuEk=' 
WHERE 
  key_id = '0dfacdbb53a12fb6320941d917877e18952cfa802d6eaa24eaff4721965af5e3' 
  AND (
    token = 'pWdso2BCTdzLXirKb1hbmewLCtdzLQ/GNdIfKrCFuEk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048