UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LoHwfObTK8iHlsANlZsBqaZhegSriXqV0h/Y9p9iVgc=' 
WHERE 
  key_id = '2528cf8104bcc6613ac098e339e6aaea3f8c2719f7498d9b60287eaa8cb412d7' 
  AND (
    token = 'LoHwfObTK8iHlsANlZsBqaZhegSriXqV0h/Y9p9iVgc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022