UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '91cKGZknVqzlNxlF80GPqmLq9mOMpm8PX8H2bOUoFQI=' 
WHERE 
  key_id = '3510e721aa17a51e0f6a930aa92df37ab9f841935d4e1d444b8d6097ca506c0e' 
  AND (
    token = '91cKGZknVqzlNxlF80GPqmLq9mOMpm8PX8H2bOUoFQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035