UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xKHkdG7hrZtnzOwE/o8VFPNAIx05/ruQ+XtWnE510go=' 
WHERE 
  key_id = '719c7ed1aae1f2cbf570373f84100f46e0a49a0306f743928e87d67d2fc6a8f5' 
  AND (
    token = 'xKHkdG7hrZtnzOwE/o8VFPNAIx05/ruQ+XtWnE510go=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047