UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lp7Acw9DgQzCPBqA9fhz9XaVWz3/Tdc/rj9H1AJRaAI=' 
WHERE 
  key_id = '095dade2c5459b393208f68d154f6b2a5ad77711b56fab7fd672999c80f69c72' 
  AND (
    token = 'lp7Acw9DgQzCPBqA9fhz9XaVWz3/Tdc/rj9H1AJRaAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033