UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xw+X7vRwkdlMrqc1pj2muhpIVb3B57xWVg4nV2HyavI=' 
WHERE 
  key_id = '86cc11183f527aa115491e127fda3534341b771b2fa1513868b601b79d7b2965' 
  AND (
    token = 'Xw+X7vRwkdlMrqc1pj2muhpIVb3B57xWVg4nV2HyavI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032