UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AKuatnJ2D+N0aS2cKW3foWk5/68vFoNabvu7QI1T4Ps=' 
WHERE 
  key_id = 'de2edac2029f69fc1ac040d4bbfe81e521a2266461fb094cd9896bbbb317fc55' 
  AND (
    token = 'AKuatnJ2D+N0aS2cKW3foWk5/68vFoNabvu7QI1T4Ps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040