UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zPieRFV2vA9FbIY8WVutJtEDIiF680pb8HRb41N57YA=' 
WHERE 
  key_id = '16ce587405b0b596c9318dac3a0c08fa8b175de19e739d1f40fe8af6646fee18' 
  AND (
    token = 'zPieRFV2vA9FbIY8WVutJtEDIiF680pb8HRb41N57YA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027