UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CPq4cnmGUQXTTRNygS5iVVkSJDAlzfgu8NkRU57JVeI=' 
WHERE 
  key_id = '2916319cc1b4d720d02d017c3c73011236c1a2c5c07c1b7af037c46a03485eda' 
  AND (
    token = 'CPq4cnmGUQXTTRNygS5iVVkSJDAlzfgu8NkRU57JVeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036