UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DCErLok2b4SuckyH0NS/zNU/fVAqdjYhaosRumwJgWE=' 
WHERE 
  key_id = '89634e3cd96f7ccd7c98ce783b17d9db9d43c2d46f29d53e3d1103f2fa17364a' 
  AND (
    token = 'DCErLok2b4SuckyH0NS/zNU/fVAqdjYhaosRumwJgWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034